package com.pzhu;

import com.pzhu.dao.BookDao;
import com.pzhu.service.BookService;
import com.pzhu.service.impl.BookServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App1 {
    public static void main(String[] args) {
      /*  BookService bookService = new BookServiceImpl();
        bookService.save();*/
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("ApplicationContext.xml");

        BookDao bookDao1 = (BookDao) ctx.getBean("bookDao");
        bookDao1.save();

        ctx.close();
//        BookServiceImpl bookService = (BookServiceImpl)ctx.getBean("bookService");
//        bookService.save();
    }

}
